EShowType = {
    active = 1,
    layer = 2,
    pos = 3
}

ETransType = {
    Pos = 1,
    Euler = 2,
    Scale = 3
}

EDirectType = {
    X = 1,
    Y = 2,
    Z = 3
}

---@class LuaHelper
LuaHelper = LuaHelper or {}

---@param id number
---@vararg userdata
---@return string
function LuaHelper.GetStringByID(id, ...)
    local item = TableDataMgr.LanguageMgr:GetItemByKey(id)
    if(not item)then return ""; end
    return Utility.Format(item.StrDictionary, {...})
end

---@param obj UnityEngine.GameObject
---@param callBack function
function LuaHelper.AddObjClick(obj, callBack)
    UIEventListener.Get(obj).onClick = callBack
end

---@param eType string|number
---@param param userdata
function LuaHelper.DispatchEvent(eType, param)
    ZEventCenter:DispatchEvent(ZEvent(eType, param))
end

---@param isAddRem boolean
---@param eType string|number
---@param eFunc function
function LuaHelper.UpdateEvent(isAddRem, eType, eFunc)
    ZEventCenter:UPEventListener(isAddRem, eType, eFunc)
end

---@param obj UnityEngine.GameObject
---@param show boolean
function LuaHelper.SetActive(obj, show)
    Utility.SetActive(obj, EShowType.active, show)
end

---@return boolean
function LuaHelper.GetActive(obj)
    return Utility.GetActive(obj, EShowType.active)
end

function LuaHelper.GetLocalPos(obj)
    return LuaHelper.GetLocalVector(obj, ETransType.Pos)
end

function LuaHelper.SetLocalPos(obj, pos)
    LuaHelper.SetLocalVector(obj, ETransType.Pos, pos)
end

function LuaHelper.GetLocalTrans(obj, eTransType, eDirectType)
    Utility.GetLocalVector(obj.transform, eTransType, eDirectType)
end

---@param obj UnityEngine.GameObject
---@param value number
function LuaHelper.SetLocalTrans(obj, eTransType, eDirectType, value)
    Utility.SetLocalVector(obj.transform, eTransType, eDirectType, value)
end

function LuaHelper.GetLocalVector(obj, eTransType)
    Utility.GetLocalVector(obj.transform, eTransType)
end

function LuaHelper.SetLocalVector(obj, eTransType, pos)
    Utility.SetLocalVector(obj.transform, eTransType, pos)
end

function LuaHelper.GetWorldVector(obj, eTransType)
    Utility.GetWorldVector(obj.transform, eTransType)
end

function LuaHelper.SetWorldVector(obj, eTransType, pos)
    Utility.SetWorldVector(obj.transform, eTransType, pos)
end